/*
 * Copyright 2022-2029 heshuixing(https://gitee.com/heshuixing)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.mercury.ec.framework.air.core.client.dto.order.create;

import com.mercury.ec.framework.air.core.client.validator.AirClientGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 机票生成订单 Request DTO
 *
 * @author hesx
 */
@Data
@Schema(description = "管理后台 - 创建订单 Request VO")
public class AirOrderCreateReqDTO {

    @Schema(description = "渠道编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "102")
    @NotNull(message = "渠道编号不能为空")
    private Long channelId;

    @Schema(description = "预定参数加密串", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
    @NotBlank(message = "预定参数加密串不能为空", groups = {AirClientGroup.Qunar.class})
    private String bookingKey;

    @Schema(description = "预定参数加密串", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
    @NotBlank(message = "预定参数加密串不能为空", groups = {AirClientGroup.Qunar.class})
    private String bookingSecret;

    @Schema(description = "预订office", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
    @NotBlank(message = "预订office不能为空", groups = {AirClientGroup.Sunstn.class})
    private String bookOffice;

    @Schema(description = "联系人手机", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
    @NotBlank(message = "联系人手机不能为空", groups = {AirClientGroup.Sunstn.class})
    private String contactMobile;

    @Valid
    @Schema(description = "行程信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "[]")
    @NotEmpty(message = "行程信息不能为空")
    private List<AirOrderRouteCreateReqDTO> routes;

    @Valid
    @Schema(description = "乘客信息", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "乘客信息不能为空")
    private List<AirOrderPassengerCreateReqDTO> passengers;
}
